home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / CoreFoundation / CFSet.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  3.9 KB  |  164 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        CFSet.h
  3.  
  4.      Contains:    CoreFoundation set collection
  5.  
  6.      Version:    Technology:    Mac OS X
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __COREFOUNDATION_CFSET__
  18. #define __COREFOUNDATION_CFSET__
  19.  
  20. #ifndef __COREFOUNDATION_CFBASE__
  21.     #include <CoreFoundation\CFBase.h>
  22. #endif
  23.  
  24.  
  25.  
  26.  
  27.  
  28. #if PRAGMA_ONCE
  29. #pragma once
  30. #endif
  31.  
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35.  
  36. #if PRAGMA_IMPORT
  37. #pragma import on
  38. #endif
  39.  
  40. #if PRAGMA_STRUCT_ALIGN
  41.     #pragma options align=mac68k
  42. #elif PRAGMA_STRUCT_PACKPUSH
  43.     #pragma pack(push, 2)
  44. #elif PRAGMA_STRUCT_PACK
  45.     #pragma pack(2)
  46. #endif
  47.  
  48. typedef CALLBACK_API_C( const void *, CFSetRetainCallBack )(CFAllocatorRef allocator, const void *ptr);
  49. typedef CALLBACK_API_C( void , CFSetReleaseCallBack )(CFAllocatorRef allocator, const void *ptr);
  50. typedef CALLBACK_API_C( CFStringRef , CFSetCopyDescriptionCallBack )(const void *ptr);
  51. typedef CALLBACK_API_C( Boolean , CFSetEqualCallBack )(const void *ptr1, const void *ptr2);
  52. typedef CALLBACK_API_C( CFHashCode , CFSetHashCallBack )(const void *ptr);
  53.  
  54. struct CFSetCallBacks {
  55.     CFIndex                         version;
  56.     CFSetRetainCallBack             retain;
  57.     CFSetReleaseCallBack             release;
  58.     CFSetCopyDescriptionCallBack     copyDescription;
  59.     CFSetEqualCallBack                 equal;
  60.     CFSetHashCallBack                 hash;
  61. };
  62. typedef struct CFSetCallBacks            CFSetCallBacks;
  63. extern const CFSetCallBacks kCFTypeSetCallBacks;
  64. extern const CFSetCallBacks kCFCopyStringSetCallBacks;
  65. typedef CALLBACK_API_C( void , CFSetApplierFunction )(const void *val, void *context);
  66. typedef const struct __CFSet * CFSetRef;
  67. typedef struct __CFSet * CFMutableSetRef;
  68.  
  69. EXTERN_API_C( CFTypeID )
  70. CFSetGetTypeID                    (void);
  71.  
  72.  
  73. EXTERN_API_C( CFSetRef )
  74. CFSetCreate                        (CFAllocatorRef         allocator,
  75.                                  const void **            values,
  76.                                  CFIndex                 numValues,
  77.                                  const CFSetCallBacks *    callBacks);
  78.  
  79. EXTERN_API_C( CFSetRef )
  80. CFSetCreateCopy                    (CFAllocatorRef         allocator,
  81.                                  CFSetRef                 theSet);
  82.  
  83. EXTERN_API_C( CFMutableSetRef )
  84. CFSetCreateMutable                (CFAllocatorRef         allocator,
  85.                                  CFIndex                 capacity,
  86.                                  const CFSetCallBacks *    callBacks);
  87.  
  88. EXTERN_API_C( CFMutableSetRef )
  89. CFSetCreateMutableCopy            (CFAllocatorRef         allocator,
  90.                                  CFIndex                 capacity,
  91.                                  CFSetRef                 theSet);
  92.  
  93.  
  94. EXTERN_API_C( CFIndex )
  95. CFSetGetCount                    (CFSetRef                 theSet);
  96.  
  97. EXTERN_API_C( CFIndex )
  98. CFSetGetCountOfValue            (CFSetRef                 theSet,
  99.                                  const void *            value);
  100.  
  101. EXTERN_API_C( Boolean )
  102. CFSetContainsValue                (CFSetRef                 theSet,
  103.                                  const void *            value);
  104.  
  105. EXTERN_API_C( const void *)
  106. CFSetGetValue                    (CFSetRef                 theSet,
  107.                                  const void *            candidate);
  108.  
  109. EXTERN_API_C( Boolean )
  110. CFSetGetValueIfPresent            (CFSetRef                 theSet,
  111.                                  const void *            candidate,
  112.                                  const void **            value);
  113.  
  114. EXTERN_API_C( void )
  115. CFSetGetValues                    (CFSetRef                 theSet,
  116.                                  const void **            values);
  117.  
  118. EXTERN_API_C( void )
  119. CFSetApplyFunction                (CFSetRef                 theSet,
  120.                                  CFSetApplierFunction     applier,
  121.                                  void *                    context);
  122.  
  123.  
  124. EXTERN_API_C( void )
  125. CFSetAddValue                    (CFMutableSetRef         theSet,
  126.                                  const void *            value);
  127.  
  128. EXTERN_API_C( void )
  129. CFSetReplaceValue                (CFMutableSetRef         theSet,
  130.                                  const void *            value);
  131.  
  132. EXTERN_API_C( void )
  133. CFSetSetValue                    (CFMutableSetRef         theSet,
  134.                                  const void *            value);
  135.  
  136. EXTERN_API_C( void )
  137. CFSetRemoveValue                (CFMutableSetRef         theSet,
  138.                                  const void *            value);
  139.  
  140. EXTERN_API_C( void )
  141. CFSetRemoveAllValues            (CFMutableSetRef         theSet);
  142.  
  143.  
  144. #if PRAGMA_STRUCT_ALIGN
  145.     #pragma options align=reset
  146. #elif PRAGMA_STRUCT_PACKPUSH
  147.     #pragma pack(pop)
  148. #elif PRAGMA_STRUCT_PACK
  149.     #pragma pack()
  150. #endif
  151.  
  152. #ifdef PRAGMA_IMPORT_OFF
  153. #pragma import off
  154. #elif PRAGMA_IMPORT
  155. #pragma import reset
  156. #endif
  157.  
  158. #ifdef __cplusplus
  159. }
  160. #endif
  161.  
  162. #endif /* __COREFOUNDATION_CFSET__ */
  163.  
  164.